package com.huo.SprinBootDmeo.controller;

import com.huo.SprinBootDmeo.entity.CallBackResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:
 * @USER: yangw
 * @Date: 2018/3/31
 * @Time: 22:08
 * @version:1.0
 */
@RestController
public class SpringBootDemoController {
    @Autowired
    private MongoTemplate mongoTemplate;

    @RequestMapping(value = "/callback",method = RequestMethod.POST)
    public String callback(@RequestBody String parmas){
        System.out.println(parmas);
        CallBackResult backResult = new CallBackResult();
        backResult.setId(10000781122l);
        backResult.setResult(parmas);
        mongoTemplate.save(backResult);
        return "success";
    }
}
